(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



PhaseMatchAngle::usage="PhaseMatchAngle[{{\!\(\*SubscriptBox[\(\[Omega]\), \(1\)]\),\!\(\*SubscriptBox[\(\[Theta]\), \(1\)]\)}\[CenterEllipsis]}] calculates the phase matched angle of emission for a nonlinear polarization driven by multiple input fields at \!\(\*SubscriptBox[\(\[Omega]\), \(i\)]\) and at input angle \!\(\*SubscriptBox[\(\[Theta]\), \(i\)]\) assuming the calculation is being performed where n=1 for all light frequencies (air or vacuum). All fields must be coplanar, inclusion of out-of-plane PM is planned. 

PhaseMatchAngle[{{\!\(\*SubscriptBox[\(\[Omega]\), \(1\)]\),\!\(\*SubscriptBox[\(\[Theta]\), \(1\)]\),\!\(\*SubscriptBox[\(n\), \(1\)]\)}\[CenterEllipsis]},\!\(\*SubscriptBox[\(n\), \(wm\)]\)] specified the material refractive index for all input fields and index for the wave-mixed frequency \!\(\*SubscriptBox[\(n\), \(wm\)]\)."

Incidence::usage="Incidence is an option for InputTransferC specifying the input beam is incident from the medium 0 (First, default) or medium k+1 (Last).";
InterfaceSide::usage="InterfaceSide is an option for InputTransferC that specifies from which side of the interface the local field should be calculated.  Top side is First (Default), bottom side is Last.  Either option gives identical results for InputTransferC, this was a checking mechanism for model accuracy.";
AzimuthAngle::usage="AzimuthAngle is an option for InputTransferC that specifies the input beam is incident in a plane rotated from sample xz plane by AzimuthAngle.  This has not been tested thoroughly.";
TransferCoefficientMethod::usage="TransferCoefficientMethod is an option for InputTransferC that specifies how the local interfacial field is calculated.  Possible values are \"SII\" for calculation from subsystem II or \"PartialSTC\" for calculation from a geometric series in the partial system transfer coefficients and the layer phase.  Either should give the same result for InputTransferC, this was a checking mechanism for model accuracy.";
LocalFieldsFromLimits::usage="LocalFieldsFromLimits is an option for InputTransferC that specifies whether to use boundary conditions to calculate input local fields or add a sheet layer and calculate fields in the limit of zero thickness. Default is False.  Either method should give the same result for InputTransferC, this was a checking mechanism for model accuracy. See also option SheetThickness.";
SheetThickness::usage="SheetThickness is an option for InputTransferC that is used if the option LocalFieldsFromLimits->True. Default is SheetThickness->0. The user can play with giving a finite thickness to the interfacial sheet layer.  Set InterfaceSide->First or Last to choose calculating the fields at the bottom or top, respectively, interfaces of the sheet layer.  A nonzero but small SheetThickness results in InputTransferC that differs slightly from all other methods of calculating InputTransferC.";

DetectionSide::usage="DetectionSide is an option for tOUT that specifies on which side of the system the generated fields are to be calculated. Choices are First for medium 0 or Last for medium k+1, i.e. reflection or transmission geometry.";

FresnelL::usage="FresnelL[\"vDirPos\", \!\(\*SubscriptBox[\(\[Theta]\), \(i\)]\),\!\(\*SubscriptBox[\(n\), \(i\)]\),\!\(\*SubscriptBox[\(n\), \(j\)]\), \!\(\*SubscriptBox[\(n\), \(sheet\)]\)] gives the matrix of common L-factors for generated fields at the interface between medium i and medium j in the \"vDirPos\" position and directionality from the interface.  \!\(\*SubscriptBox[\(\[Theta]\), \(j\)]\) is computed internally using Snell's Law.
FresnelL[\"vDirPos\", \!\(\*SubscriptBox[\(\[Theta]\), \(i\)]\),\!\(\*SubscriptBox[\(\[Theta]\), \(j\)]\),\!\(\*SubscriptBox[\(n\), \(i\)]\),\!\(\*SubscriptBox[\(n\), \(j\)]\), \!\(\*SubscriptBox[\(n\), \(sheet\)]\)] gives the L-matrix with \!\(\*SubscriptBox[\(\[Theta]\), \(j\)]\) precomputed.

\"vDirPos\" = \"v+\" for fields generated in the positive z direction
\"vDirPos\" = \"v-'\" for fields generated in the negative z direction";

NonlinearPolarization::usage="NonlinearPolarization[\[Chi],{\!\(\*SubsuperscriptBox[\(E\), \(1\), \(in\)]\),\!\(\*SubsuperscriptBox[\(E\), \(2\), \(in\)]\)...\!\(\*SubsuperscriptBox[\(E\), \(m\), \(in\)]\)}] performs the n-tuple dot product of m+1-rank \[Chi] tensor and the m-rank outer product of m input fields \!\(\*SubsuperscriptBox[\(E\), \(i\), \(in\)]\)={\!\(\*SubsuperscriptBox[\(E\), \(i, x\), \(in\)]\),\!\(\*SubsuperscriptBox[\(E\), \(i, y\), \(in\)]\),\!\(\*SubsuperscriptBox[\(E\), \(i, z\), \(in\)]\)}.  This returns the nonlinear polarization {\!\(\*SubscriptBox[\(P\), \(x\)]\),\!\(\*SubscriptBox[\(P\), \(y\)]\),\!\(\*SubscriptBox[\(P\), \(z\)]\)} due to nonlinear interaction with all input fields described by the \[Chi] tensor.  For the common case of SFG, this computes P = \[Chi]:\!\(\*SubsuperscriptBox[\(E\), \(1\), \(in\)]\)\[CircleTimes]\!\(\*SubsuperscriptBox[\(E\), \(1\), \(in\)]\).";

InputTransferC::usage="InputTransferC[{\!\(\*SuperscriptBox[\(E\), \(p\)]\),\!\(\*SuperscriptBox[\(E\), \(s\)]\)}, \[Omega],\!\(\*SubscriptBox[\(\[Theta]\), \(0\)]\),\!\(\*SubscriptBox[\(n\), \(0\)]\),{{\!\(\*SubscriptBox[\(n\), \(1\)]\),\!\(\*SubscriptBox[\(d\), \(1\)]\)},{\!\(\*SubscriptBox[\(n\), \(2\)]\),\!\(\*SubscriptBox[\(d\), \(2\)]\)}..{\!\(\*SubscriptBox[\(n\), \(k\)]\),\!\(\*SubscriptBox[\(d\), \(k\)]\)}},\!\(\*SubscriptBox[\(n\), \(k + 1\)]\),v,\!\(\*SubscriptBox[\(n\), \(v\)]\)] calculates the input field transfer coefficient at interface v from input electric field (not necessarily normalized) Jones vector {\!\(\*SuperscriptBox[\(E\), \(p\)]\),\!\(\*SuperscriptBox[\(E\), \(s\)]\)} at frequency \[Omega] with input angle \!\(\*SubscriptBox[\(\[Theta]\), \(0\)]\), bulk material refractive indices \!\(\*SubscriptBox[\(n\), \(i\)]\), thin film layer thicknesses \!\(\*SubscriptBox[\(d\), \(i\)]\), and interfacial polarized sheet refractive index \!\(\*SubscriptBox[\(n\), \(sheet\)]\).  Refraction angles are calculated internally using Snell's law. Returns {Ex,Ey,Ez} at interface v.
InputTransferC[{\!\(\*SuperscriptBox[\(E\), \(p\)]\),\!\(\*SuperscriptBox[\(E\), \(s\)]\)}, \[Omega],{{\!\(\*SubscriptBox[\(\[Theta]\), \(0\)]\),\!\(\*SubscriptBox[\(n\), \(0\)]\)},{\!\(\*SubscriptBox[\(\[Theta]\), \(1\)]\),\!\(\*SubscriptBox[\(n\), \(1\)]\),\!\(\*SubscriptBox[\(d\), \(1\)]\)},{\!\(\*SubscriptBox[\(\[Theta]\), \(2\)]\),\!\(\*SubscriptBox[\(n\), \(2\)]\),\!\(\*SubscriptBox[\(d\), \(2\)]\)}..{\!\(\*SubscriptBox[\(\[Theta]\), \(k\)]\),\!\(\*SubscriptBox[\(n\), \(k\)]\),\!\(\*SubscriptBox[\(d\), \(k\)]\)},{\!\(\*SubscriptBox[\(\[Theta]\), \(k + 1\)]\),\!\(\*SubscriptBox[\(n\), \(k + 1\)]\)}},v,\!\(\*SubscriptBox[\(n\), \(sheet\)]\)] calculates {Ex,Ey,Ez} with refraction angles specified. Eq. 45.";
OutputTransferC::usage="OutputTransferC[{\!\(\*SuperscriptBox[\(P\), \(x\)]\),\!\(\*SuperscriptBox[\(P\), \(y\)]\),\!\(\*SuperscriptBox[\(P\), \(z\)]\)}, \[Omega],\!\(\*SubsuperscriptBox[\(\[Theta]\), \(0\), \(PM\)]\),\!\(\*SubscriptBox[\(n\), \(0\)]\),{{\!\(\*SubscriptBox[\(n\), \(1\)]\),\!\(\*SubscriptBox[\(d\), \(1\)]\)},{\!\(\*SubscriptBox[\(n\), \(2\)]\),\!\(\*SubscriptBox[\(d\), \(2\)]\)}..{\!\(\*SubscriptBox[\(n\), \(k\)]\),\!\(\*SubscriptBox[\(d\), \(k\)]\)}},\!\(\*SubscriptBox[\(n\), \(k + 1\)]\),v,\!\(\*SubscriptBox[\(n\), \(v\)]\)] calculates the output field transfer coefficient of the nonlinear polarization {\!\(\*SuperscriptBox[\(P\), \(x\)]\),\!\(\*SuperscriptBox[\(P\), \(y\)]\),\!\(\*SuperscriptBox[\(P\), \(z\)]\)} induced at interface v oscillating at frequency \[Omega] and with phased-matching angle in medium 0 \!\(\*SubsuperscriptBox[\(\[Theta]\), \(0\), \(PM\)]\), bulk material refractive indices \!\(\*SubscriptBox[\(n\), \(i\)]\), thin film layer thicknesses \!\(\*SubscriptBox[\(d\), \(i\)]\), and interfacial polarized sheet refractive index \!\(\*SubscriptBox[\(n\), \(sheet\)]\). Returns {Ep,Es,0}. 
OutputTransferC[{\!\(\*SuperscriptBox[\(P\), \(x\)]\),\!\(\*SuperscriptBox[\(P\), \(y\)]\),\!\(\*SuperscriptBox[\(P\), \(z\)]\)},\[Omega],{{\!\(\*SubsuperscriptBox[\(\[Theta]\), \(0\), \(PM\)]\),\!\(\*SubscriptBox[\(n\), \(0\)]\)},{\!\(\*SubsuperscriptBox[\(\[Theta]\), \(1\), \(PM\)]\),\!\(\*SubscriptBox[\(n\), \(1\)]\),\!\(\*SubscriptBox[\(d\), \(1\)]\)},{\!\(\*SubsuperscriptBox[\(\[Theta]\), \(2\), \(PM\)]\),\!\(\*SubscriptBox[\(n\), \(2\)]\),\!\(\*SubscriptBox[\(d\), \(2\)]\)}..{\!\(\*SubsuperscriptBox[\(\[Theta]\), \(l\), \(PM\)]\),\!\(\*SubscriptBox[\(n\), \(k\)]\),\!\(\*SubscriptBox[\(d\), \(k\)]\)},{\!\(\*SubsuperscriptBox[\(\[Theta]\), \(k + 1\), \(PM\)]\),\!\(\*SubscriptBox[\(n\), \(k + 1\)]\)}},v,\!\(\*SubscriptBox[\(n\), \(sheet\)]\)] calculates Ep,Es,0} with phase-matched angles specified in all materials. Eq. 59. ";

